<template>
	<fui-input :label="label" :borderTop="borderTop" :placeholder="placeholder" :password="password" @input="onInput"
		label-size="26" placeholderStyle="fontSize:26rpx">
		<fui-icon :name="password ? 'invisible' : 'visible'" color="#B2B2B2" :size="50" @click="togglePassword" />
	</fui-input>
</template>

<script>
	export default {
		props: {
			label: {
				type: String,
				default: '密码',
			},
			placeholder: {
				type: String,
				default: '请输入密码',
			},
			borderTop: {
				type: Boolean,
				default: false,
			},
		},
		data() {
			return {
				password: true,
			};
		},
		methods: {
			togglePassword() {
				this.password = !this.password;
			},
			onInput(e) {
				this.$emit('input', e);
			},
		},
	};
</script>

<style scoped lang="scss">
	/* 可以根据需要调整样式 */
</style>